package org.as3search.providers {
	/*
	 * as3search - http://code.google.com/p/as3search
	 * Copyright (c) 2009-2010 by respective authors. All rights reserved.
	 *
	 * This library is free software; you can redistribute it and/or modify it under the
	 * terms of the GNU Lesser General Public License as published by the Free Software
	 * Foundation; either version 2.1 of the License, or (at your option) any later
	 * version.
	 *
	 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
	 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
	 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
	 *
	 * You should have received a copy of the GNU Lesser General Public License along
	 * with this library; if not, write to the Free Software Foundation, Inc.,
	 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
	 */
	
	/**
	 * <code>SearchProviderMapping</code> serves as a key-value pair
	 * for mapping collection types to provider types. It also serves
	 * as a factory for creating new <code>SearchProvider</code> instances
	 * wrapping a given collection object.
	 * 
	 * @see org.as3search.providers.SearchProvider
	 * @see org.as3search.providers.impl.SearchProviderMappingImpl
	 */
	public interface SearchProviderMapping {
		/**
		 * Creates a new <code>SearchProvider</code> wrapping the given
		 * object.
		 * @param	value	The item to be wrapped in the new <code>SearchProvider</code>.
		 * @return	Returns a new <code>SearchProvider</code> instance wrapping <code>value</code>.
		 */
		function create(value:Object):SearchProvider;
		/**
		 * The class type of the target object which <code>providerType</code>
		 * is attached to. This value serves as the key in the key-value pair.
		 * When creating new search providers, the following check
		 * should be evaluated before executing <code>create()</code>:
		 * <listing version="3.0">
		 * if (value is mapping.targetType) {
		 * 	var provider:SearchProvider = mapping.create(value);
		 * }
		 * </listing>
		 */
		function get targetType():Class;
		/**
		 * The class type of the provider to create for objects of the target type.
		 * This property is used in <code>create()</code> to dynamically create
		 * a new instance of <code>SearchProvider</code>.
		 */
		function get providerType():Class;
	}
}